//axios请求

import axios from "axios"

//创建一个请求方式
const http = axios.create({
    //设置请求地址的base地址
    baseURL: 'http://shop.bluej.cn/api',
    //单位 ms
    timeout: 5000,
});

export const post = (url, data, options) => {
    return new Promise((resolve, reject) => {
        http
            .post(url, data, {
                headers: {
                    "Content-Type": "application/json",
                }
            })
            .then((res) => {
                resolve(res.data);
            })
            .catch(err => {
                reject(err)
            })
    });

}